<?php
/*
Plugin Name: LibraryPress
Version: 1.0-beta
Plugin URI: http://bibliopress.codeplex.com/
Description: Manage Book library.
Author: Sithu Thwin
Author URI: http://myanmapress.com/
 */
 if(defined('WPBL_VERSION')) return;
define('WPBL_VERSION', '1.0-beta');
define('WPBL_PLUGIN_PATH', dirname(__FILE__));
define('WPBL_PLUGIN_FOLDER', basename(WPBL_PLUGIN_PATH));
define('WPBL_PLUGIN_DIR', WP_PLUGIN_DIR. '/librarypress');

if(defined('WP_ADMIN') && defined('FORCE_SSL_ADMIN') && FORCE_SSL_ADMIN){
    define('WPBL_PLUGIN_URL', rtrim(str_replace('http://','https://',get_option('siteurl')),'/') . '/'. PLUGINDIR . '/' . basename(dirname(__FILE__)) );
}else{
    define('WPBL_PLUGIN_URL', rtrim(get_option('siteurl'),'/') . '/'. PLUGINDIR . '/' . basename(dirname(__FILE__)) );
}
include_once (WPBL_PLUGIN_PATH.'/register_types.php');
//include (WPBL_PLUGIN_PATH.'/library.php');
include (WPBL_PLUGIN_PATH.'/widgets.php');
include (WPBL_PLUGIN_PATH.'/meta_boxes.php');
include (WPBL_PLUGIN_PATH.'/availablity.php');
include (WPBL_PLUGIN_PATH.'/admin_widget.php');
include (WPBL_PLUGIN_PATH.'/edit_columns.php');
include (WPBL_PLUGIN_PATH.'/nav_menu.php');
include (WPBL_PLUGIN_PATH.'/user_roles.php');

add_action( 'init', 'create_post_type', 0 );
add_action( 'init', 'create_taxonomies_type', 0 );
if ( function_exists( 'register_theme_directory') )
	register_theme_directory( WPBL_PLUGIN_DIR . '/librarypress_theme' );
function wpbl_activate(){
delete_site_transient( 'theme_roots' );

		if ( !defined('WP_DEFAULT_THEME') )
		define( 'WP_DEFAULT_THEME', 'librarypress' );
		


 switch_theme( 'librarypress', 'librarypress' );
}
add_action('admin_init','wpbl_activate');


?>